package com.thn.netty.chat.server;

import com.thn.netty.chat.codec.CommandCodec;
import com.thn.netty.chat.codec.IMPB;

public class LoginParam {
	
	private String szSessionId="";
	private int ulUserid;
	private int ucLoginType;
	private int ucLoginStatus;
	private int ucLoginDevice;
	private int ucLoginNetworkType;
    private int usLoginFreeswitchConn;
    
    public static final int LT_UNKNOWN = 0;
    public static final int LT_PC = 1;
    public static final int LT_MOBILE = 2;
    public static final int LT_WEB = 4;
    public static final int LT_ALL= 0xFF; // 获取所有状态的集合
    
    
    
    
    
	public String getSzSessionId() {
		return szSessionId;
	}
	public void setSzSessionId(String szSessionId) {
		this.szSessionId = szSessionId;
	}
	public int getUlUserid() {
		return ulUserid;
	}
	public void setUlUserid(int ulUserid) {
		this.ulUserid = ulUserid;
	}
	public int getUcLoginType() {
		return ucLoginType;
	}
	public void setUcLoginType(int ucLoginType) {
		this.ucLoginType = ucLoginType;
	}
	public int getUcLoginStatus() {
		return ucLoginStatus;
	}
	public void setUcLoginStatus(int ucLoginStatus) {
		this.ucLoginStatus = ucLoginStatus;
	}
	public int getUcLoginDevice() {
		return ucLoginDevice;
	}
	public void setUcLoginDevice(int ucLoginDevice) {
		this.ucLoginDevice = ucLoginDevice;
	}
	public int getUcLoginNetworkType() {
		return ucLoginNetworkType;
	}
	public void setUcLoginNetworkType(int ucLoginNetworkType) {
		this.ucLoginNetworkType = ucLoginNetworkType;
	}
	public int getUsLoginFreeswitchConn() {
		return usLoginFreeswitchConn;
	}
	public void setUsLoginFreeswitchConn(int usLoginFreeswitchConn) {
		this.usLoginFreeswitchConn = usLoginFreeswitchConn;
	}	
	
	public static int GET_LOGIN_TYPE(int ucLoginDevice)
	{
		int loginType=0;
		if(ucLoginDevice==IMPB.Presence.DEVICE_TYPE.PC_VALUE)
		{
			loginType=LT_PC;
		}
		else if(ucLoginDevice==IMPB.Presence.DEVICE_TYPE.ANDROID_VALUE||ucLoginDevice==IMPB.Presence.DEVICE_TYPE.IOS_VALUE)
		{
			loginType=LT_MOBILE;
		}
		else if(ucLoginDevice==IMPB.Presence.DEVICE_TYPE.WEB_VALUE)
		{
			loginType=LT_UNKNOWN;
		}				
	   return loginType;
	}
	
	public static Boolean Presence_TYPE_IsValid(int value) {
		  switch(value) {
		    case 0:
		    case 1:
		    case 2:
		    case 3:
		      return true;
		    default:
		      return false;
		  }
		}
	
	public static Boolean Presence_DEVICE_TYPE_IsValid(int value) {
		  switch(value) {
		    case 0:
		    case 1:
		    case 2:
		    case 3:
		    case 4:
		      return true;
		    default:
		      return false;
		  }
		}
	public static Boolean Presence_NETWORK_TYPE_IsValid(int value) {
		  switch(value) {
		    case 0:
		    case 1:
		    case 2:
		    case 3:
		    case 4:
		    case 5:
		      return true;
		    default:
		      return false;
		  }
		}
}
